<?php

if (!defined('BASEPATH')) exit('No direct script access allowed');

/**
 * 目录辅助函数 扩展
 * 扩展方法 http://codeigniter.org.cn/user_guide/general/helpers.html
 * @Thanks https://github.com/phpwind/windframework
 */


/**
 * 创建目录
 *
 * @param string $path 目录路径
 * @param int $permissions 权限
 * @return boolean
 */
if (! function_exists('directory_mk'))
{
	function directory_mk($path, $permissions = 0777)
	{
		return @mkdir($path, $permissions);
	}
}

/**
 * 递归的创建目录
 *
 * @param string $path 目录路径
 * @param int $permissions 权限
 * @return boolean
 */
if (! function_exists('directory_mk_recur'))
{
	function directory_mk_recur($path, $permissions = 0777)
	{
		if (is_dir($path)) return true;
		$_path = dirname($path);
		if ($_path !== $path) self::directory_mk_recur($_path, $permissions);
		return self::directory_mk($path, $permissions);
	}
}


/* End of file MY_directory_helper.php */
/* Location: ./application/helpers/MY_directory_helper.php */
